//
//  AticleFootView.m
//  diaoyuren
//
//  Created by 单安成 on 15/12/23.
//  Copyright © 2015年 game. All rights reserved.
//

#import "AticleFootView.h"

#import "Masonry.h"

@interface AticleFootView()<UITextFieldDelegate>
{

    BOOL Open;
    BOOL Close;

}

@property (nonatomic,strong) UIButton *btn;

@end
@implementation AticleFootView
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        self.userInteractionEnabled = YES;
        
        
        
          }

    return self;
}

-(UIButton *)textbtn{
    if (!_textbtn) {
        _textbtn = [UIButton buttonWithType:UIButtonTypeSystem];
        _textbtn.frame = CGRectMake(10, 10, SCREEN_WIDTH-10-80, H(self)-20);
        _textbtn.layer.borderColor = linColor.CGColor;
        _textbtn.layer.borderWidth = 0.7;
        _textbtn.backgroundColor = [UIColor clearColor];

        radius(_textbtn, 5);
       
        UIView *lin = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 0.5)];
        lin.backgroundColor = linColor;
        [self addSubview:lin];
        
        UIImageView *pen = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_bi"]];
        pen.frame = CGRectMake(20, (H(self)-25)/2, 25, 25);
        [self addSubview:pen];
        
        UILabel *txet = [[UILabel alloc]initWithFrame:CGRectMake(Width(pen)+10, 10, 100,H(self)-20)];
        txet.text = @"我来说两句";
        txet.font = font(SCREEN_WIDTH*0.05);
        txet.alpha = 0.4;
        
        [self addSubview:txet];

        [self addSubview:_textbtn];
        [self bringSubviewToFront:_textbtn];
        
    }
        return _textbtn;
}


-(UIButton *)comBtn{
    if (!_comBtn) {
        _comBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        
        [_comBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        _comBtn.titleLabel.font = font(SCREEN_WIDTH*0.05);
        
        _comBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
        
        [_comBtn setTitleColor:RGBA(0, 0, 0, 0.4) forState:UIControlStateNormal];
        
        _comBtn.titleLabel.font = font(SCREEN_WIDTH*0.045);
        
        _comBtn.frame = CGRectMake(Width(self.textbtn)+3, (H(self)-40)/2, 80, 40);
        
        [_comBtn setImage:[UIImage imageNamed:@"btn-reply"] forState:UIControlStateNormal];
        
        [self addSubview:_comBtn];
    }

    return _comBtn;
}
@end
